using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Interpolation
{
    /// <summary>
    /// <para>Trend</para>
    /// <para>Interpolates a raster surface from points using a trend technique.</para>
    /// <para>使用趋势技术从点插值栅格表面。</para>
    /// </summary>    
    [DisplayName("Trend")]
    public class Trend : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Trend()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_point_features">
        /// <para>Input point features</para>
        /// <para>The input point features containing the z-values to be interpolated into a surface raster.</para>
        /// <para>包含要插值到表面栅格中的 z 值的输入点要素。</para>
        /// </param>
        /// <param name="_z_field">
        /// <para>Z value field</para>
        /// <para><xdoc>
        ///   <para>The field that holds a height or magnitude value for each point.</para>
        ///   <para>This can be a numeric field or the Shape field if the input point features contain z-values.</para>
        ///   <para>If the regression type is Logistic, the values in the field can only be 0 or 1.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>保存每个点的高度或大小值的字段。</para>
        ///   <para>这可以是数值字段，也可以是形状字段（如果输入点要素包含 z 值）。</para>
        ///   <para>如果回归类型为 Logistic，则字段中的值只能为 0 或 1。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output interpolated surface raster.</para>
        ///   <para>It is always a floating-point raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出插值表面栅格。</para>
        ///   <para>它始终是浮点栅格。</para>
        /// </xdoc></para>
        /// </param>
        public Trend(object _in_point_features, object _z_field, object _out_raster)
        {
            this._in_point_features = _in_point_features;
            this._z_field = _z_field;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Trend";

        public override string CallName => "sa.Trend";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_point_features, _z_field, _out_raster, _cell_size, _order, _regression_type.GetGPValue(), _out_rms_file];

        /// <summary>
        /// <para>Input point features</para>
        /// <para>The input point features containing the z-values to be interpolated into a surface raster.</para>
        /// <para>包含要插值到表面栅格中的 z 值的输入点要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input point features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_point_features { get; set; }


        /// <summary>
        /// <para>Z value field</para>
        /// <para><xdoc>
        ///   <para>The field that holds a height or magnitude value for each point.</para>
        ///   <para>This can be a numeric field or the Shape field if the input point features contain z-values.</para>
        ///   <para>If the regression type is Logistic, the values in the field can only be 0 or 1.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>保存每个点的高度或大小值的字段。</para>
        ///   <para>这可以是数值字段，也可以是形状字段（如果输入点要素包含 z 值）。</para>
        ///   <para>如果回归类型为 Logistic，则字段中的值只能为 0 或 1。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Z value field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _z_field { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output interpolated surface raster.</para>
        ///   <para>It is always a floating-point raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出插值表面栅格。</para>
        ///   <para>它始终是浮点栅格。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Output cell size</para>
        /// <para><xdoc>
        ///   <para>The cell size of the output raster that will be created.</para>
        ///   <para>This parameter can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn't been explicitly specified as the parameter value, the environment cell size value will be used if specified; otherwise, additional rules will be used to calculate it from the other inputs. See the usage section for more detail.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将创建的输出栅格的像元大小。</para>
        ///   <para>此参数可以由数值定义，也可以从现有栅格数据集中获取。如果尚未将像元大小显式指定为参数值，则在指定的情况下将使用环境像元大小值;否则，将使用其他规则从其他输入计算它。有关详细信息，请参阅用法部分。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Polynomial order</para>
        /// <para><xdoc>
        ///   <para>The order of the polynomial.</para>
        ///   <para>This must be an integer between 1 and 12. A value of 1 will fit a flat plane to the points, and a higher value will fit a more complex surface. The default is 1.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>多项式的顺序。</para>
        ///   <para>这必须是介于 1 和 12 之间的整数。值为 1 将平整平面拟合到点，值越高则拟合更复杂的曲面。默认值为 1。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Polynomial order")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _order { get; set; } = 1;


        /// <summary>
        /// <para>Type of regression</para>
        /// <para><xdoc>
        ///   <para>The type of regression to be performed.</para>
        ///   <bulletList>
        ///     <bullet_item>Linear—Polynomial regression is performed to fit a least-squares surface to the set of input points. This is applicable for continuous types of data.</bullet_item><para/>
        ///     <bullet_item>Logistic—Logistic trend surface analysis is performed. It generates a continuous probability surface for binary, or dichotomous, types of data.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要执行的回归类型。</para>
        ///   <bulletList>
        ///     <bullet_item>线性 - 执行多项式回归以将最小二乘曲面拟合到输入点集。这适用于连续类型的数据。</bullet_item><para/>
        ///     <bullet_item>Logistic—执行 Logistic 趋势曲面分析。它为二进制或二分类数据类型生成连续概率曲面。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Type of regression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _regression_type_value _regression_type { get; set; } = _regression_type_value._LINEAR;

        public enum _regression_type_value
        {
            /// <summary>
            /// <para>Linear</para>
            /// <para>Linear—Polynomial regression is performed to fit a least-squares surface to the set of input points. This is applicable for continuous types of data.</para>
            /// <para>线性 - 执行多项式回归以将最小二乘曲面拟合到输入点集。这适用于连续类型的数据。</para>
            /// </summary>
            [Description("Linear")]
            [GPEnumValue("LINEAR")]
            _LINEAR,

            /// <summary>
            /// <para>Logistic</para>
            /// <para>Logistic—Logistic trend surface analysis is performed. It generates a continuous probability surface for binary, or dichotomous, types of data.</para>
            /// <para>Logistic—执行 Logistic 趋势曲面分析。它为二进制或二分类数据类型生成连续概率曲面。</para>
            /// </summary>
            [Description("Logistic")]
            [GPEnumValue("LOGISTIC")]
            _LOGISTIC,

        }

        /// <summary>
        /// <para>Output RMS file</para>
        /// <para><xdoc>
        ///   <para>File name for the output text file that contains information about the RMS error and the Chi-Square of the interpolation.</para>
        ///   <para>The extension must be .txt.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出文本文件的文件名，其中包含有关 RMS 误差和插值卡方的信息。</para>
        ///   <para>扩展必须.txt。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output RMS file")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_rms_file { get; set; } = null;


        public Trend SetEnv(int? autoCommit = null, object cellSize = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}